package com.mm.vo.web.user;

import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述: 权限树形菜单VO
 *
 * @author: yanglin
 * @Date: 2021-08-06-16:35
 * @Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PermissionVo {

    /**
     * ID
     */
    public Integer id;

    /**
     * 父节点ID
     */
    public Integer pId;

    /**
     * 父节点ID 字符串
     */
    public String pIds;

    /**
     * 图标
     */
    public String icon = "fa-stop-circle";

    /**
     * 菜单名称
     */
    public String title;

    /**
     * URL
     */
    public String href;

    /**
     * 子集
     */
    public List<PermissionVo> children = new ArrayList<>();

    /**
     * 是否选择
     */
    public boolean checked = false;

    @Builder
    public PermissionVo(Integer id, Integer pId, String pIds, String icon, String title, String href, List<PermissionVo> children, boolean checked) {
        this.id = id;
        this.pId = pId;
        this.pIds = pIds;
        this.icon = icon;
        this.title = title;
        this.href = href;
        this.children = children;
        this.checked = checked;
    }
}
